package com.share.tool.dsc.web;

import com.share.common.common.Result;
import com.share.tool.dsc.service.CompareService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@Slf4j
@RestController
public class CompareController {
    @Autowired
    private CompareService compareService;

    @RequestMapping(value = "/db")
    public Result dbMork(String p) {
        log.info("接收到参数p={}",p);
        String[] split = p.split(",");
        String  table = split[0];
        String  columnId = split[1];
        String  columnTime = split[2];
        String  startTime = split[3];
        String  endTime = split[4];
        String ids = compareService.byId(table,columnId,columnTime,startTime,endTime);
        return Result.success(ids);
    }
}
